/**
 * @Description: 自研api与LcuApi地址
 * @author QianZhou Xu
 * @date 2023/9/7
 */
import { client, lcu } from '@renderer/common/constant'

const getApi = (params) => {
  const {
    puuid = '',
    profileIconId = 0,
    iconId = 0,
    gameId = 0,
    beginIndex = 0,
    endIndex = 9,
    name_ = ''
  } = params || {}

  return {
    lcuApi: {
      curUserInfo: `${lcu}/lol-summoner/v1/current-summoner`, // 获取当前用户信息
      avatarImg: `${lcu}/lol-game-data/assets/v1/profile-icons/${profileIconId}.jpg`, // 获取头像
      getEnvironment: `${lcu}/riotclient/v1/crash-reporting/environment`, // 获取大区
      getMatchHistory: `${lcu}/lol-match-history/v1/products/lol/${puuid}/matches?begIndex=${beginIndex}&endIndex=${endIndex}`, // 查询战绩
      getAllGameData: `${lcu}/lol-game-data/assets/v1/items.json`,
      getAllHeroData: `https://op.gg/api/v1.0/internal/bypass/meta/champions?hl=zh_CN`,
      getChampionInfo: `${lcu}/lol-game-data/assets/v1/champions/${iconId}.json`,
      getChampionIcon: `${lcu}/lol-game-data/assets/v1/champion-icons/${iconId}.png`,
      getRanked: `${lcu}/lol-ranked/v1/ranked-stats/${puuid}`,
      getGamesDetail: `${lcu}/lol-match-history/v1/games/${gameId}`,
      getPuuidByName: `${lcu}/lol-summoner/v1/summoners?name=${name_}`,
      getNameByPuuid: `${lcu}/lol-summoner/v2/summoners/puuid/${puuid}`,
      getRoomInfo: `${lcu}/lol-champ-select/v1/session`,
      getCurPlayData: `${client}/liveclientdata/allgamedata`,
      getPlayStatus: `${lcu}/lol-lobby/v2/lobby/matchmaking/search-state`,
      autoAcceptPlay: `${lcu}/lol-matchmaking/v1/ready-check/accept`
    }
  }
}

export default getApi
